TARGET  := hello_dt
 
obj-m += $(TARGET).o
 
PWD := $(shell pwd)
ARCH=arm

KERNEL=/home/Linux/arm-buildroot/arm/output/build/linux-5.15.18

CROSS_COMPILE=/home/Linux/arm-buildroot/arm/output/host/bin/arm-buildroot-linux-gnueabihf-

#BIN_PATH = /home/flinn/bin/vexpress/
#ROOTFS = /home/flinn/tmp/rootfs
#DT     = exynos4412-vexpress
 
default:
	$(MAKE) ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} -C $(KERNEL)  M=$(PWD) modules
	#make -C $(KERNEL) M=`pwd` modules
 
clean:
	make -C $(KERNEL) M=`pwd` clean
        
#install:
	#make -C $(KERNEL) M=`pwd` modules_install INSTALL_MOD_PATH=$(ROOTFS)
	#sudo cp $(TARGET).ko $(ROOTFS)
	#sudo cp $(DT).dtb $(BIN_PATH)
 
#dtbs:
	#dtc -I dtb -O dts vexpress.dts -o vexpress.dtb
	#dtc -O dtb -o $(DT).dtb $(DT).dts
